#include<cstdio>
#include<string.h>
#include<string>
#include<iostream>
#include<fstream>
#include<vector>
#include<cstdlib>
#include<set>
using namespace std;

class multikey{
  public:
    string  key1;
    string   key2;


    multikey(string k1, string k2){
    	key1=k1; key2 = k2;
    }

    bool operator<(const multikey &right) const{
        if ( key1.compare(right.key1)==0 ) {
               return key2.compare(right.key2)<0;
        }
        else {
            return key1.compare(right.key1)<0;
        }
    }
};

class vectorkey{
public:
	vector<short> key;

	vectorkey(vector<short> k){
		key = k;
	}

    bool operator<(const vectorkey &V) const{
    	if(key.size()!=V.key.size()){
    		cout<<"ERROR: Wrong size of Key in VectorMap" <<endl;
    		exit(EXIT_FAILURE);
    	}
    	int *sign = (int*)malloc(key.size()*sizeof(int));
    	for(unsigned i=0;i<key.size();i++) sign[i] = V.key[i] - key[i];

    	unsigned count=0;
    	//Find the key of first mismatch
    	while(count!=key.size() && sign[count]==0) count++;

    	if(count==key.size()) return false;
    	else if(sign[count]>0) return true;
    	else return false;

    }


};

class multiIntKey {
  public:
    int  key1;
    int key2;


    multiIntKey(int k1, int k2)
      : key1(k1), key2(k2) {}

    bool operator<(const multiIntKey &right) const
    {
        if ( key1 == right.key1 ) {

                return key2 < right.key2;

        }
        else {
            return key1 < right.key1;
        }
    }
};

